/*
 * Copyright (c)  2015~2020, xforceplus
 * All rights reserved.
 * Project:datacare-orm
 * Id: Sql.java   2020-09-29 22-07-21
 * Author: Evan
 */
package cn.datacare.orm.annotation;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import static cn.datacare.orm.util.StringUtils.EMPTY;

/**
 * <p>
 * Title:
 * </p>
 * <p>
 * Description:
 * </p>
 * <p>
 * Copyright: 2015~2020
 * </p>
 * <p>
 * Company/Department: xforceplus
 * </p>
 *
 * @author Evan
 * <b>Creation Time:</b> 2020-09-29 22-07-21
 * @since V1.0
 */

@Target({java.lang.annotation.ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public @interface Sql {

    /**
     * statement类型.
     *
     * @return SqlStatementType
     */
    SqlStatementType type() default SqlStatementType.AUTO;


    /**
     * 采用这个sql，如update xxx set a = ? where id = ?
     * @return sql
     */
    String value() default EMPTY;


    /**
     * @return 返回类型，默认是Mapper类的泛型，需要特别声明才用这个
     * 2.9.0 后不再以这个为准
     */
    @Deprecated Class returnType() default Void.class;
}
